package sw6.xmlvalidator.issues;

/**
 * Representation of an issue. From this abstract 
 * class, it is possible to define specific types 
 * of issues, e.g. warnings and errors.
 * @author Lasse
 */
public abstract class Issue {
	
	public static enum TYPE { WARNING, ERROR }
	private String _msg;
	private int _lineNumber;

	/**
	 * Issue constructor.
	 * @param msg Issue message.
	 * @param lineNumber Linenumber reference to the issue.
	 */
	public Issue(String msg, int lineNumber) {
		this._msg 			= msg;
		this._lineNumber 	= lineNumber;
	}

	/**
	 * Gets the error message of an issue.
	 * @return The error message of an issue.
	 */
	public String getMsg() {
		return _msg;
	}

	/**
	 * Gets the linenumber of an issue.
	 * @return The linenumber of an issue.
	 */
	public int getLineNumber() {
		return _lineNumber;
	}

	@Override
	public String toString() {
		return "LINE " + _lineNumber + ": " + _msg;
	}
}
